import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from "@/components/Login.vue";

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Login',
    component: Login
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import('@/components/Register.vue')
  },
  {
    path: '/forget-password',
    name: 'ForgetPassword',
    component: () => import('@/components/ForgetPassword.vue')
  },
  {
    path: '/blog-homepage',
    name: 'BlogHomepage',
    component: () => import('@/components/BlogHomepage.vue'),
    meta:{ hideBackground: true},
    children: [
      {
        path: '/',
        name: 'BlogHome',
        component: () => import('@/views/blogHomepage-views/HomeView.vue'),
        meta:{ hideBackground: true}
      },
      {
        path: '/user-management',
        name: 'BlogUserManage',
        component: () => import('@/views/blogHomepage-views/UserManageView.vue'),
        meta:{ hideBackground: true}
      },
      {
        path: 'article-management',
        name: 'BlogArticleManage',
        component: () => import('@/views/blogHomepage-views/ArticleManageView.vue'),
        meta:{ hideBackground: true}
      },
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
